// Copyright (C) joyinter
// All rights reserved.
// 
// Author : Jiang Li
// Date   : 2004-10-7

#ifndef __MYTRAYICON_H_COMMON_UI__
#define __MYTRAYICON_H_COMMON_UI__

#pragma once
#include <common\ui\MyCoolMenu.h>
#include ".\CoolPopupMenu.h"

class CCoolMenuList;
class CCoolPopupMenu;

//##ModelId=44C4B5E002AF
class CMyTrayIcon :
    public CCmdTarget
{
    DECLARE_DYNAMIC(CMyTrayIcon) 

protected:

	//##ModelId=44C4B5E002B2
    NOTIFYICONDATA m_nid; // struct for Shell_NotifyIcon args 
	//##ModelId=44C4B5E002C0
    CCoolMenuList *m_pMenuList;
   
public:

	//##ModelId=44C4B5E002C5
    CMenu m_menu; 
	//##ModelId=44C4B5E002CA
	CMenu* m_pSubMenu;


	//##ModelId=44C4B5E002CF
    CCoolPopupMenu *m_mnu;
	//##ModelId=44C4B5E002D3
    CMyTrayIcon(UINT uID,CCoolPopupMenu *m_mnu);
	
	//##ModelId=44C4B5E002D6
    virtual ~CMyTrayIcon(void);

	//##ModelId=44C4B5E002DF
	virtual LRESULT OnTrayNotification(WPARAM uID, LPARAM lEvent,bool windowstatus); 
	//##ModelId=44C4B5E002EE
    void SetNotificationWnd(CWnd* pNotifyWnd, UINT uCbMsg); 

	//##ModelId=44C4B5E002F1
    BOOL SetIcon(UINT uID); // main variant you want to use 
	//##ModelId=44C4B5E002FD
    BOOL SetIcon(HICON hicon, LPCSTR lpTip); 
	//##ModelId=44C4B5E00300
    BOOL SetIcon(LPCTSTR lpResName, LPCSTR lpTip) 

    {
        return SetIcon(lpResName ? 
            AfxGetApp()->LoadIcon(lpResName) : NULL, lpTip);
    } 

	//##ModelId=44C4B5E0030D
    BOOL SetStandardIcon(LPCTSTR lpszIconName, LPCSTR lpTip)
    {
        return SetIcon(::LoadIcon(NULL, lpszIconName), lpTip);
    }
};

#endif  // __MYTRAYICON_H_COMMON_UI__
